#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;
typedef unsigned long long ull;
typedef long double ldb;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back
#define vec vector<int>

int read(){int x = 0,sgn = 1;char ch = getchar();for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);return x*sgn;}

const int N = 310;
const int mod = 998244353;

int top,n,m;

struct matrix{
	int arr[N][N];
	int* operator [](int x){return arr[x];}
	const int* operator [](int x)const{return arr[x];}
	matrix(int x = 0){memset(arr,0,sizeof arr);if(x) for(int i = 1;i <= top;i++) arr[i][i] = x;}
	friend matrix operator * (matrix a,matrix b){
		matrix c;
		for(int i = 1;i <= top;i++)
			for(int j = 1;j <= top;j++)
				if(a[i][j])
					for(int k = 1;k <= top;k++)
						c[i][k] = (c[i][k] + (ll) a[i][j] * b[j][k] % mod) % mod;
		return c;
	}
	void out(){for(int i = 1;i <= top;i++,cerr<<endl) for(int j = 1;j <= top;j++,cerr<<" ") cerr<<arr[i][j];cerr<<endl;}
}t;

template <typename T> T qp(T x,int t){T res(1); for(;t;t >>= 1,x = x * x) if(t & 1) res = res * x;return res;}

namespace Trie{
	int ch[N][30],cnt = 1;
	bool en[N];
	void insert(char *s){
		int ls = strlen(s + 1),p = 1;
		for(int i = 1;i <= ls;i++){
			int x = s[i] - 'a'; if(!ch[p][x]) ch[p][x] = ++cnt;
			p = ch[p][x];
		}
		en[p] = 1;
	}
}

char s[50];

map<pii,int> dic;

queue<pii> q;

int id(pii d){
	if(d.fi > d.se) swap(d.fi,d.se);
	if(!dic[d]) dic[d] = ++top,q.push(d);
	return dic[d];
}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,m = in;
	for(int i = 1;i <= n;i++) scanf("%s",s + 1),Trie :: insert(s);
	id(pii(1,1));
	while(q.size()){
		pii d = q.front(); q.pop();
		int x = d.fi,y = d.se,pid = id(d);
		for(int i = 0;i < 26;i++){
			int nx = Trie :: ch[x][i],ny = Trie :: ch[y][i];
			if(!nx || !ny) continue;
			t[pid][id(pii(nx,ny))]++;
			if(Trie :: en[nx]) t[pid][id(pii(1,ny))]++;
			if(Trie :: en[ny]) t[pid][id(pii(nx,1))]++;
			if(Trie :: en[nx] && Trie :: en[ny]) t[pid][id(pii(1,1))]++;
		}
	}
	ll ans = qp(t,m)[1][1];
	printf("%lld\n",ans);
	return 0;
}
